﻿var themeDir = &quot;&quot;;
/* ----------------------------------------------------------------- */
function parseURL(url) {
    var parser = document.createElement(&#39;a&#39;),
        searchObject = {},
        queries, split, i;
    // Let the browser do the work
    parser.href = url;
    // Convert query string to object
    queries = parser.search.replace(/^\?/, &#39;&#39;).split(&#39;&amp;&#39;);
    for( i = 0; i &lt; queries.length; i++ ) {
        split = queries[i].split(&#39;=&#39;);
        searchObject[split[0]] = split[1];
    }
    return {
        protocol: parser.protocol,
        host: parser.host,
        hostname: parser.hostname,
        port: parser.port,
        pathname: parser.pathname,
        search: parser.search,
        searchObject: searchObject,
        hash: parser.hash
    };
}

/* ----------------------------------------------------------------- */
function checkLabels(ar){
for(l=0;l&lt;ar.length;l++){
  if(ar[l].indexOf(&quot;Sức khỏe,Làm đẹp,Kỹ năng,Kinh doanh,Đa cấp,Môi trường,Du lịch,Danh ngôn,Công nghệ,Sách&quot;)!=-1){}
}
}

/* ----------------------------------------------------------------- */
$(document).ready(function () {
$(&#39;#awVN&#39;).rssfeed(&#39;https://www.facebook.com/feeds/page.php?format=atom10&amp;id=432918790062765&#39;,
  {header: false,content: false, date: false, linktarget: &#39;blank&#39;, dateformat: &#39;dd/MM/yyyy&#39;}, function(e) {
		$(e).find(&#39;div.rssBody&#39;).vTicker({ showItems: 1});
	});
});


/* ----------------------------------------------------------------- */
title=[];date=[];sum=[];comment=[];href=[];labels=[];thumb=[];author_Name=[];author_URI=[];author_avatar=[];

function rssLabels(f){

var me = document.currentScript;
ind = parseURL(me.src).searchObject.ind;
id = parseURL(me.src).searchObject.id;
max = parseURL(me.src).searchObject[&quot;max-results&quot;];

th=(ind!=1?&quot;http://lh4.googleusercontent.com/-OENiPOIFL6w/VFw-BTaySuI/AAAAAAABnz4/D3eOrg62PGA/s0/logo7.png&quot;:&quot;http://lh3.googleusercontent.com/-MaFZAEONhwI/VFuYrI-beiI/AAAAAAABnys/MZzRQQl_TUw/s120/logo.png&quot;);

f=f.feed.entry;
//total=f.feed.openSearch$totalResults.$t;
//document.write(&quot;<b>&quot;+total+&quot;</b>&quot;)
for(j=0;j&lt;f.length;j++){
	title[j]=f[j].title.$t.substring(0,60);
	date[j]=f[j].updated.$t;
	date[j]=date[j].replace(/^(\d{4})-(\d+)-(\d+).*?$/g,&quot;$3/$2/$1&quot;)
	sum[j]=f[j].summary.$t.substring(0,60);
	comment[j]=f[1].link[1].title.replace(/(\d+).*$/,&quot;$1&quot;);
	href[j]=f[j].link[4].href;
	labels[j]=[];for(i=0;i&lt;f[j].category.length;i++){labels[j][i]=f[j].category[i].term}
	thumb[j]=String(f[j].media$thumbnail);
	thumb[j]=(thumb[j]!=&quot;undefined&quot;?f[j].media$thumbnail.url:th)
	author_Name[j]=f[j].author[0].name.$t;
	author_URI[j]=f[j].author[0].uri.$t;
	author_avatar[j]=f[j].author[0].gd$image.src;

}

for(k=0;k&lt;max;k++){
if(ind==1){
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<li><div class='thumbnail'><img height='70' src='&quot; + thumb[k] + &quot;' width='70'/></div>&quot;
	+ &quot;<div class='post-right'><h5><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a></h5>&quot;
	+ &quot;<div class='entry-meta'><span class='author'>Đăng bởi <a href='&quot; + author_URI[k] + &quot;' rel='author'>&quot; + author_Name[k] + &quot;</a></span>&quot;
	+ &quot;<span class='sep'>-</span><span class='date'>&quot; + date[k] +&quot;</span></div></div></li>&quot;)}

else if(ind==2){
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<li><a href='&quot; + href[k] + &quot;'>&quot;
	+ &quot;<img alt='&quot; + k + &quot;' height='320' src='&quot; + thumb[k] + &quot;' width='800'/></a>&quot;
	+ &quot;<div class='post-info'><div class='entry-meta'>&quot;
	+ &quot;<span class='entry-cats'><span class='main-color-bg cat4'><h5><a href='&quot; + labels[k][0] + &quot;'>&quot; + labels[k][0] + &quot;</a></h5></span></span>&quot;
	+ &quot;</div>&quot;
	+ &quot;<div class='title'><h3><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a></h3></div>&quot;
	+ &quot;<div class='post-excerpt'>&quot; + sum[k] + &quot;</div>&quot;
	+ &quot;<div class='more'><span class='sep main-color-bg'/>&quot;
	+ &quot;<span class='link main-color-bg'><h5><a href='&quot; + href[k] + &quot;'>Chi tiết</a></h5></span>&quot;
	+ &quot;</div>&quot;
	+ &quot;</div>&quot;
	+ &quot;</li>&quot;)}

else if(ind==3 &amp;&amp; k==0){
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<article class='single-col-post'>&quot;
	+ &quot;<div class='thumbnail overlay'>&quot;
	+ &quot;<a href='&quot; + href[k] + &quot;'><img alt='&quot; + k + &quot;' class='' height='340' src='&quot; + thumb[k] + &quot;' width='620'/></a>&quot;
	+ &quot;</div>&quot;
	+ &quot;<header class='entry-header'>&quot;
	+ &quot;<div class='entry-meta'>&quot;
	+ &quot;<span class='entry-cats'>&quot;
	+ &quot;<span class='main-color-bg cat3'><h5><a href='/search/label/&quot; + labels[k][0] + &quot;'>&quot; + labels[k][0] + &quot;</a></h5></span>&quot;
	+ &quot;<span class='main-color-bg cat4'><h5><a href='/search/label/&quot; + labels[k][1] + &quot;'>&quot; + labels[k][1] + &quot;</a></h5></span>&quot;
	+ &quot;</span>&quot;
	+ &quot;<span class='author'>Đăng bởi <a href='&quot; + author_URI[k] + &quot;' rel='author'>&quot; + author_Name[k] + &quot;</a></span>&quot;
	+ &quot;<span class='sep'>-</span><span class='date'>&quot; + date[k] + &quot;</span>&quot;
	+ &quot;<div class='review-stars'><div style='width:90%'/></div>&quot;
	+ &quot;</div>&quot;
	+ &quot;<h2><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a></h2>&quot;
	+ &quot;</header>&quot;
	+ &quot;<div class='entry-excerpt'><p>&quot; + sum[k] + &quot;</p></div>&quot;
	+ &quot;<footer class='entry-footer'>&quot;
	+ &quot;<div class='read-more main-color-bg'><h5><a href='&quot; + href[k] + &quot;'>Chi tiết</a></h5></div>&quot;
	+ &quot;<div class='tags'>&quot;
	+ &quot;<span>Nhãn</span>&quot;
	+ &quot;<a href='/tag/festival/' rel='tag'>Festival</a> &quot;
	+ &quot;<a href='/tag/germany/' rel='tag'>Germany</a> &quot;
	+ &quot;<a href='/tag/spring/' rel='tag'>Spring</a>&quot;
	+ &quot;</div>&quot;
	+ &quot;<div class='comments'>&quot;
	+ &quot;<span class='comment-count main-color-bg'><a href='#comments'>&quot; + comment[k] + &quot;</a></span>&quot;
	+ &quot;<span class='comment'><h5><a href='#'>Bình luận</a></h5></span>&quot;
	+ &quot;</div>&quot;
	+ &quot;</footer>&quot;
	+ &quot;</article>&quot;)}

else if(ind==4){
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<article class='item-post'>&quot;
	+ &quot;<div class='thumbnail overlay'>&quot;
	+ &quot;<a href='&quot; + thumb[k] + &quot;'><img alt='10' class='attachment-wt-thumb-300_130 wp-post-image' height='130' src='&quot; + thumb[k] + &quot;' width='300'/></a>&quot;
	+ &quot;</div>&quot;
	+ &quot;<div class='cat-bullet'><span class='cat'>&quot;
	+ &quot;<span class='main-color-bg cat4'/>&quot;
	+ &quot;<h6><a href='/search/label/&quot; + labels[k][0] +&quot;'>&quot; + labels[k][0] + &quot;</a></h6>&quot;
	+ &quot;</span>&quot;
	+ &quot;</div>&quot;
	+ &quot;<h4><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a>&quot;
	+ &quot;</h4>&quot;
	+ &quot;<div class='entry-meta'>&quot;
	+ &quot;<div class='review-stars'><div style='width:80%'/></div>&quot;
	+ &quot;<span class='date'>&quot; + date[k] + &quot;</span>&quot;
	+ &quot;</div>&quot;
	+ &quot;</article>&quot;)}

else if(ind==5 &amp;&amp; k==0){
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<article class='post-39 post type-post status-publish format-standard hentry category-world tag-festival tag-germany tag-spring' id='post-39'>&quot;
	+ &quot;<div class='thumbnail overlay'>&quot;
	+ &quot;<a href=''><img alt='10' class='' height='225' src='&quot; + thumb[k] + &quot;' width='425'/></a>&quot;
	+ &quot;<div class='cat-bullet'><span class='cat'><span class='main-color-bg cat4'/><h6><a href='/search/label/&quot; + labels[k][0] + &quot;'>&quot; + labels[k][0] + &quot;</a></h6></span></div>&quot;
	+ &quot;</div>&quot;
	+ &quot;<header class='entry-header'>&quot;
	+ &quot;<div class='entry-meta'>&quot;
	+ &quot;<span class='author'>Đăng bởi <a href='&quot; + author_URI + &quot;' rel='author'>&quot; + author_Name[k] + &quot;</a></span>&quot;
	+ &quot;<span class='sep'>-</span><span class='date'>&quot; + date[k] + &quot;</span>&quot;
	+ &quot;<div class='review-stars'><div style='width:80%'/></div>&quot;
	+ &quot;</div>&quot;
	+ &quot;<h3><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a></h3>&quot;
	+ &quot;</header>&quot;
	+ &quot;<div class='entry-excerpt'><p>&quot; + sum[k] + &quot;</p></div>&quot;
	+ &quot;<footer class='entry-footer'>&quot;
	+ &quot;<div class='read-more main-color-bg'><h5><a href='&quot; + href[k] + &quot;'>Chi tiết</a></h5></div>&quot;
	+ &quot;<div class='comments'>&quot;
	+ &quot;<span class='comment-count main-color-bg'><a href='#comments'>&quot; + comment[k] + &quot;</a></span>&quot;
	+ &quot;<span class='comment'><h5><a href='#comments'>Bình luận</a></h5></span>&quot;
	+ &quot;</div>&quot;
	+ &quot;</footer>&quot;
	+ &quot;</article>&quot;)}

else if(ind==6){
  last=(k%2==0?&quot;col-last&quot;:&quot;&quot;);
$( &quot;#&quot;+id ).append(&quot;&quot;
	+ &quot;<div class='col col-425 &quot; + last + &quot;'>&quot;
	+ &quot;<article class='post-39 post type-post status-publish format-standard hentry category-world tag-festival tag-germany tag-spring' id='post-39'>&quot;
	+ &quot;<div class='thumbnail overlay'>&quot;
	+ &quot;<a href='&quot; + href[k] + &quot;'><img alt='&quot; + k + &quot;' class='' height='225' src='&quot; + thumb[k] + &quot;' width='425'/></a>&quot;
	+ &quot;<div class='cat-bullet'><span class='cat'><span class='main-color-bg cat4'/><h6><a href='/search/label/Sức khỏe'>Sức khỏe</a></h6></span></div>&quot;
	+ &quot;</div>&quot;
	+ &quot;<header class='entry-header'>&quot;
	+ &quot;<div class='entry-meta'>&quot;
	+ &quot;<span class='author'>Đăng bởi <a href='&quot; + author_URI[k] + &quot;' rel='author'>&quot; + author_Name[k] + &quot;</a></span>&quot;
	+ &quot;<span class='sep'>-</span><span class='date'>&quot; + date[k] + &quot;</span>&quot;
	+ &quot;<div class='review-stars'><div style='width:80%'/></div>&quot;
	+ &quot;</div>&quot;
	+ &quot;<h3><a href='&quot; + href[k] + &quot;'>&quot; + title[k] + &quot;</a></h3>&quot;
	+ &quot;</header>&quot;
	+ &quot;<div class='entry-excerpt'><p>&quot; + sum[k] + &quot;</p></div>&quot;
	+ &quot;<footer class='entry-footer'>&quot;
	+ &quot;<div class='read-more main-color-bg'><h5><a href='&quot; + href[k] + &quot;'>Chi tiết</a></h5></div>&quot;
	+ &quot;<div class='comments'>&quot;
	+ &quot;<span class='comment-count main-color-bg'><a href='#comments'>&quot; + comment[k] + &quot;</a></span>&quot;
	+ &quot;<span class='comment'><h5><a href='#comments'>Bình luận</a></h5></span>&quot;
	+ &quot;</div>&quot;
	+ &quot;</footer>&quot;
	+ &quot;</article>&quot;
	+ &quot;</div>&quot;
)}

}
}

/* ----------------------------------------------------------------- */
var 
 numComments  = 5,
 showAvatar  = true,
 avatarSize  = 60,
 roundAvatar = true,
 characters  = 40,
 showMorelink = false,
 moreLinktext = "»»",
 defaultAvatar  = "http://4.bp.blogspot.com/-SRSVCXNxbAc/UrbxxXd06YI/AAAAAAAAFl4/332qncR9pD4/s1600/default-avatar.jpg",
 hideCredits = true;
